<?php
/*
 * @Author: your name
 * @Date: 2021-12-07 10:59:47
 * @LastEditTime: 2021-12-21 22:10:37
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \property\routes\findShop.php
 */


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\find_shop\User;                   //用户类
use App\Http\Controllers\find_shop\Rental;                 //免费发布
use App\Http\Controllers\find_shop\Housing;                //写字楼
use App\Http\Controllers\find_shop\Store;                  //商铺
use App\Http\Controllers\find_shop\Area;                   //区域管理
use App\Http\Controllers\find_shop\TowerBuilding;          //大厦
use App\Http\Controllers\find_shop\Settings;               //首页        
use App\Http\Controllers\find_shop\Admins;                 //后台管理员类
use App\Http\Controllers\find_shop\CollectionHistory;      //历史记录和收藏
use App\Http\Controllers\find_shop\FindShopSubscribe;      //预约看房





/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
//     return $request->user();
// });

Route::prefix('/user')->group(function () {
    Route::post('/wechatLogin', [User::class, 'userLoginWechat']);           //微信小程序登录
    Route::post('/toutiaoLogin', [User::class, 'userLoginToutiao']);         //头条小程序登录
    Route::post('/loginOut', [User::class, 'loginOut']);                     //退出登录
    Route::post('/checkToken', [User::class, 'checkToken']);                 //检查登录状态
});

Route::middleware('CheckShopToken')->group(function () {                      //检查是否登录
    Route::prefix('/rental')->group(function () {
        Route::post('/freeDistribution', [Rental::class, 'freeDistribution']);                 //免费发布
        Route::post('/freeDistributionList', [Rental::class, 'freeDistributionList']);         //发布进度
    });

    Route::prefix('/collectionHistory')->group(function () {
        Route::post('/historyAdd', [CollectionHistory::class, 'historyAdd']);                          //登录之后添加历史记录
        Route::post('/collectionOne', [CollectionHistory::class, 'collectionOne']);                    //收藏和取消收藏
        Route::post('/collectionList', [CollectionHistory::class, 'collectionList']);                    //收藏记录
    });

    Route::prefix('/findShopSubscribe')->group(function(){
        Route::post('/subscribeAdd',[FindShopSubscribe::class,'subscribeAdd']);                         //预约申请
        Route::post('/subscribeList',[FindShopSubscribe::class,'subscribeList']);                         //预约申请

        
    });
    

    // collectionHisoryAdd
});


Route::prefix('/housing')->group(function () {
    Route::post('/housingList', [Housing::class, 'housingList']);             //写字楼查询
    Route::post('/housingSelOne', [Housing::class, 'housingSelOne']);         //写字楼查询单条数据
    Route::post('/belongsBuilding', [Housing::class, 'belongsBuilding']);         //写字楼查询单条数据
    Route::post('/housingWebListRand', [Housing::class, 'housingWebListRand']);         //随机查数据
    Route::post('/housingBuildingList', [Housing::class, 'housingBuildingList']);         //大厦内页
    Route::post('/housingStoreList', [Housing::class, 'housingStoreList']);         //大厦内页

});


Route::prefix('/store')->group(function () {
    Route::post('/storeList', [Store::class, 'storeList']);                //商铺查询
    Route::post('/storeSelOne', [Store::class, 'storeSelOne']);                //商铺查询
    Route::post('/storeWebListRand', [Store::class, 'storeWebListRand']);                //商铺查询
});


Route::prefix('/area')->group(function () {
    Route::post('/areaList', [Area::class, 'areaList']);                //区域管理
});

Route::prefix('/towerBuilding')->group(function () {
    Route::post('/buildingSelOne', [TowerBuilding::class, 'buildingSelOne']);                //区域管理
    Route::post('/buildingWebListRand', [TowerBuilding::class, 'buildingWebListRand']);                //区域管理

});

Route::prefix('/settings')->group(function () {
    Route::post('/settingSelOne', [Settings::class, 'settingSelOne']);                //区域管理

});

Route::prefix('/admins')->group(function () {
    Route::post('/expertsList', [Admins::class, 'expertsList']);                    //区域管理
    Route::post('/expertsSelOne', [Admins::class, 'expertsSelOne']);                //区域查单条

});

Route::prefix('/collectionHistory')->group(function (){
    Route::post('/historyList', [CollectionHistory::class, 'historyList']);                    //历史记录
    Route::post('/historyAddOne', [CollectionHistory::class, 'historyAddOne']);                    //历史添加单条


 
});
